{* $Id$ *}
{include_core file="admin/lib/header.html" title="短信展示"}
<div class="page-header border-bottom clearfix">
  <h2 class="left">短信管理<span>{if $info}编辑{else}添加{/if}短信</span></h2>
  <a href="{AnUrl('aliysms/admin')}" class="btn btn-default btn-sm right">&lt;&nbsp;返回短信列表</a>
</div>
<!--start:短信新增-->
<div class="add-form">
  <form class="js_creatForm" action="{AnUrl('aliysms/admin/create')}" method="post" enctype="multipart/form-data">
    <table class="table" cellpadding="0" cellspacing="0">
      <tr>
        <th><label for="" class="add-f-label">接受者：</label></th>
        <td>
          <div>
            <label for="" class="add-f-label"><input type="text" name="sms[mobile]" class="add-f-label" maxlength="11" value="{$sms.mobile}" placeholder="请输入手机号" /></label>
          </div>
        </td>
      </tr>
      <tr>
        <th><label for="" class="add-f-label">短信类别：</label></th>
        <td>
          <label for="" class="add-f-label">
            <select name="sms[sign_name]">
              <option value=""> == 请选择 == </option>
              {foreach $sign_name_list as $k=>$v}
                <option value="{$k}">{$v['sign_name']}</option>
              {/foreach}
            </select>
        </td>
      </tr>
      <tr>
        <th><label for="" class="add-f-label">短信内容：</label></th>
        <td>
          <div>
            <label for="" class="add-f-label"><input type="text" name="sms[code]" placeholder="输入短信内容(找回密码就是新的密码)" /></label>
          </div>
        </td>
      </tr>
      <tr>
        <th>&nbsp;</th>
        <td class="noborder">
          <button type="submit" class="btn btn-success js_submit">&nbsp;&nbsp;&nbsp;发送&nbsp;&nbsp;&nbsp;</button>
        </td>
      </tr>

    </table>
  </form>
</div>
<!--end:短信新增-->
<script>
{literal}
$(function(){
	
	$('.js_submit').click(function(){
		
		 if ($('input[name="sms[mobile]"]').val() == '') {
			 showMsg('手机号码不能为空!');
			 return false;
		 }
		
		var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
		if (!reg.test($('input[name="sms[mobile]"]').val())) {
			  showMsg('手机号格式错误!');
			  return false;
		}
		 
		// 验证短信类别
		if ($('select[name="sms[sign_name]"]').val() == '') {
			 showMsg('还没有选择短信类别!');
			 return false;
		}
		
	});
	
	$('option').click(function(){
		// recover_password sign_contract create_marketing dispatching
		
	});
		
});
{/literal}
</script>
{include_core file="admin/lib/footer.html"}